package org.springframework.samples.mvc.basic.tipPartner;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.samples.mvc.basic.business.AbstractBusinessService;
import org.springframework.samples.mvc.basic.business.Transformer;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.proba.annotations.GenericDAO;
import com.proba.annotations.TipPartnerDAO;
import com.proba.annotations.pojo.TipPartner;

@Service
public class TipPartnerBusinessServiceImpl extends AbstractBusinessService<TipPartner, TipPartnerView> implements TipPartnerBusinessService {

	@Autowired
	private TipPartnerDAO dao;
	
	
	@Override
	protected GenericDAO<TipPartner, Long> getDao() {
		return dao;
	}

	@Override
	protected Transformer<TipPartner, TipPartnerView> getTransformer() {
		return new TipPartnerTransformer();
	}

	@Override
	@Transactional
	public List<TipPartnerView> findAll(int startIndex, int pageSize,
			TipPartnerView queryInfo) {
		return transform(dao.findByFilterParams(startIndex, pageSize, queryInfo.getId(), queryInfo.getTipPartner()));
	}

}
